<?php

namespace Modules\Chinadmin\Http\Controllers\Admin;

use Illuminate\Routing\Controller;
use Modules\System\Traits\Backend;

class Base extends Controller
{
    //增删改查基类
    use Backend;

    public function __construct(){

        //确定模型
        $modelsThis = '\Modules\\'.MDS_MODULES.'\Models\\'.MDS_CLASS.'Model';
        $this->models = new $modelsThis();

        $this->class = MDS_CLASS;
        $this->Modules = MDS_MODULES;
        $this->models->primaryKey = $this->models->primaryKey ?? "id";

        view()->share('Modules',$this->Modules);
        view()->share('class',$this->class);
        view()->share('id',$this->models->primaryKey);
        view()->share('table',$this->models->table);

    }


}
